package board

// testing new stuff
func isRay16(difference Square) bool {
	return difference&0x03 == 0 || // up & down
		(difference+8)>>4 == 0 || // left & right
		//difference>>3 == 0 || // left
		//difference>>3&0xFF == 0xFF || // right
		//(difference>>4^difference)&0xF == 0 || // up right
		//(difference>>4^difference)&0xF == 0xF // up left
		((difference+17*7)>>4^(difference+17*7))&0xF == 0 || // up right, down left
		((difference+15*7)>>4^(difference+15*7))&0xF == 0xF // up left, down right

}

// testing new stuff
func isRay15(difference Square) bool {
	return ((difference+15*7)>>4^(difference+15*7))&0xF == 0xF || // up & down
		(difference+8)>>4 == 0 || // left & right
		difference&0x03 == 0 // up right & down left
	//
	//
	//	((difference+17*7)>>4^(difference+17*7))&0xF == 0 || // up right, down left

}

// testing new stuff
func square16x12To64(square Square) int32 {
	return int32(square-(2*16+4))&0x7 + int32(square-(2*16+4))>>4
}

func square16x12To641(square Square) int32 {
	return int32(square)&0x7 + int32(square)>>4
}
